import { axios } from '@/utils/request';

const api = {
    // 项目分类
    typeAll: '/internal/type/all',
    typePage: '/internal/type/page',
    typeCreate: '/internal/type/create',
    typeUpdate: '/internal/type/update',
    typeDelete: '/internal/type/delete',
    // 项目定义
    defineParentAll: '/internal/item/getAll',
    defineAll: '/internal/item/all',
    definePage: '/internal/item/page',
    defineCreate: '/internal/item/create',
    defineUpdate: '/internal/item/update',
    defineDelete: '/internal/item/delete',
    // 评价等级定义
    levelAll: '/internal/level/all',
    levelPage: '/internal/level/page',
    levelCreate: '/internal/level/create',
    levelUpdate: '/internal/level/update',
    levelDelete: '/internal/level/delete',
    // 考评方案
    planPage: '/internal/plan/page',
    planCreate: '/internal/plan/create',
    planUpdate: '/internal/plan/update',
    planUpdateParam: '/internal/plan/updateParam',
    planDelete: '/internal/plan/delete',
    getInternalItem: '/internal/item/getInternalItem',
    getInternalPlanInfo: '/internal/plan/getInternalPlanInfo',
    // 考评计划
    taskDelete: '/internal/task/delete',
    taskUpdate: '/internal/task/update',
    // 考评任务列表
    getFinish: '/internal/task/getFinish',
    getNotFinish: '/internal/task/getNotFinish',
    getFinishAll: '/internal/task/getFinishAll',
    getNotFinishAll: '/internal/task/getNotFinishAll',
    taskListGet: '/internal/task/get',
    startInternal: '/internal/task/startInternal',
    internalCreate: '/internal/note/create',
    internalDetail: '/internal/note/get',
    internalDetailParam: '/internal/note/getParam',
    getDeptUserUrl: '/external/dept/plan/getDeptUserUrl', // 部门人员二维码
    getDeptUrl: '/external/dept/plan/getDeptUrl', // 部门二维码
    getInternalTaskDetailVO: '/internal/task/getInternalTaskDetailVO',
    getInternalTaskFinish: '/internal/task/detail/getInternalTaskFinish',
    getInternalTaskAll: '/internal/task/detail/getInternalTaskAll',
    getInternalTaskDept: '/internal/task/detail/getInternalTaskDept',
    getUserTaskDetail: '/internal/task/getUserTaskDetail',
    getDeptTaskDetail: '/internal/task/getDeptTaskDetail',
    getAllTaskDetail: '/internal/task/getAllTaskDetail',

}
export function getAllTaskDetail(params) {
    return axios({
        url: api.getAllTaskDetail,
        method: 'get',
        params
    });
}

export function getDeptTaskDetail(params) {
    return axios({
        url: api.getDeptTaskDetail,
        method: 'get',
        params
    });
}

export function getUserTaskDetail(params) {
    return axios({
        url: api.getUserTaskDetail,
        method: 'get',
        params
    });
}

// getInternalTaskDept
export function getInternalTaskDept(params) {
    return axios({
        url: api.getInternalTaskDept,
        method: 'get',
        params
    });
}

// getInternalTaskAll
export function getInternalTaskAll(params) {
    return axios({
        url: api.getInternalTaskAll,
        method: 'get',
        params
    });
}

// getInternalTaskFinish
export function getInternalTaskFinish(params) {
    return axios({
        url: api.getInternalTaskFinish,
        method: 'get',
        params
    });
}

// getInternalPlanInfo
export function getInternalPlanInfo(params) {
    return axios({
        url: api.getInternalPlanInfo,
        method: 'get',
        params
    });
}

// getInternalTaskDetailVO
export function getInternalTaskDetailVO(params) {
    return axios({
        url: api.getInternalTaskDetailVO,
        method: 'get',
        params
    });
}

export function getDeptUserUrl(params) {
    return axios({
        url: api.getDeptUserUrl,
        method: 'get',
        params
    });
}

export function getDeptUrl(params) {
    return axios({
        url: api.getDeptUrl,
        method: 'get',
        params
    });
}

// getInternalItem
export function getInternalItem(params) {
    return axios({
        url: api.getInternalItem,
        method: 'get',
        params
    });
}

// getFinishAll
export function getFinishAll(params) {
    return axios({
        url: api.getFinishAll,
        method: 'get',
        params
    });
}

export function getNotFinishAll(params) {
    return axios({
        url: api.getNotFinishAll,
        method: 'get',
        params
    });
}

export function getFinish(params) {
    return axios({
        url: api.getFinish,
        method: 'get',
        params
    });
}

export function getNotFinish(params) {
    return axios({
        url: api.getNotFinish,
        method: 'get',
        params
    });
}

export function typeAll(params) {
    return axios({
        url: api.typeAll,
        method: 'get',
        params
    });
}

export function typePage(params) {
    return axios({
        url: api.typePage,
        method: 'get',
        params
    });
}

export function typeCreate(data) {
    return axios({
        url: api.typeCreate,
        method: 'post',
        data
    });
}

export function typeUpdate(data) {
    return axios({
        url: api.typeUpdate,
        method: 'put',
        data
    });
}

export function typeDelete(id, data) {
    return axios({
        url: `${api.typeDelete}/${id}`,
        method: 'delete',
        data
    });
}

// internalDetail
export function internalDetail(params) {
    return axios({
        url: api.internalDetail,
        method: 'get',
        params
    });
}

export function internalDetailParam(params) {
    return axios({
        url: api.internalDetailParam,
        method: 'get',
        params
    });
}

export function internalCreate(data) {
    return axios({
        url: api.internalCreate,
        method: 'post',
        data
    });
}

export function startInternal(params) {
    return axios({
        url: api.startInternal,
        method: 'get',
        params
    });
}

// 考评计划列表
export function taskListGet(params) {
    return axios({
        url: api.taskListGet,
        method: 'get',
        params
    });
}

export function taskDelete(id, params) {
    return axios({
        url: `${api.taskDelete}/${id}`,
        method: 'delete',
        params
    });
}

export function taskUpdate(params) {
    return axios({
        url: api.taskUpdate,
        method: 'put',
        params
    });
}

// 考评方案
export function planPage(params) {
    return axios({
        url: api.planPage,
        method: 'get',
        params
    });
}

export function planCreate(data) {
    return axios({
        url: api.planCreate,
        method: 'post',
        data
    });
}

export function planUpdate(data) {
    return axios({
        url: api.planUpdate,
        method: 'put',
        data
    });
}

export function planUpdateParam(data) {
    return axios({
        url: api.planUpdateParam,
        method: 'put',
        data
    });
}

export function planDelete(id, data) {
    return axios({
        url: `${api.planDelete}/${id}`,
        method: 'delete',
        data
    });
}

// 项目等级定义
export function levelAll(params) {
    return axios({
        url: api.levelAll,
        method: 'get',
        params
    });
}

export function levelPage(params) {
    return axios({
        url: api.levelPage,
        method: 'get',
        params
    });
}

export function levelCreate(data) {
    return axios({
        url: api.levelCreate,
        method: 'post',
        data
    });
}

export function levelUpdate(data) {
    return axios({
        url: api.levelUpdate,
        method: 'put',
        data
    });
}

export function levelDelete(id, params) {
    return axios({
        url: `${api.levelDelete}/${id}`,
        method: 'delete',
        params
    });
}

// 项目定义
export function defineParentAll(params) {
    return axios({
        url: api.defineParentAll,
        method: 'get',
        params
    });
}

export function defineAll(params) {
    return axios({
        url: api.defineAll,
        method: 'get',
        params
    });
}

export function definePage(params) {
    return axios({
        url: api.definePage,
        method: 'get',
        params
    });
}

export function defineCreate(data) {
    return axios({
        url: api.defineCreate,
        method: 'post',
        data
    });
}

export function defineUpdate(data) {
    return axios({
        url: api.defineUpdate,
        method: 'put',
        data
    });
}

export function defineDelete(id, params) {
    return axios({
        url: `${api.defineDelete}/${id}`,
        method: 'delete',
        params
    });
}